﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ErrTypeManage.aspx.cs" Inherits="ErrTypeManage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table width="842" border="0" cellpadding="0" cellspacing="0" align="center">
            <tr style="color: blue; font-size: 20px;">
                <td style="height: 20px">
                    <img src="images/list.gif" width="20px" height="20px">设备管理--&gt;故障类别管理
                </td>
            </tr>
            <tr>
                <td>
                    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                        BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px"
                        CellPadding="3" DataKeyNames="errTypeId" DataSourceID="errTypeInfoDataSource"
                        Width="842px" OnRowDataBound="GridView1_RowDataBound" CellSpacing="2">
                        <Columns>
                            <asp:BoundField DataField="errTypeId" HeaderText="故障类别编号" InsertVisible="False" ReadOnly="True"
                                SortExpression="errTypeId" />
                            <asp:BoundField DataField="errTypeName" HeaderText="故障类别名称" SortExpression="errTypeName" />
                            <asp:TemplateField HeaderText="操作">
                                <EditItemTemplate>
                                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
                                        Text="更新"></asp:LinkButton>
                                    &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel"
                                        Text="取消"></asp:LinkButton>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:LinkButton ID="lkbEdit" runat="server" CausesValidation="false" CommandName="Edit"><img src='images/edit.gif' height="14" width="14" border="0" />修改</asp:LinkButton>
                                    <asp:LinkButton ID="lkbDel" runat="server" CausesValidation="False" CommandName="Delete"
                                        OnClientClick="return confirm('您确认删除该记录吗?');"><img src='images/delete.gif' height="14" width="14" border="0" />删除</asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <FooterStyle BackColor="#6A5ACD" />
                        <RowStyle BackColor="#D6DFF7" ForeColor="#8C4510" />
                        <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
                        <PagerStyle ForeColor="#FFFFFF" HorizontalAlign="Center" BackColor="#6A5ACD" />
                        <HeaderStyle BackColor="#799AE1" Font-Bold="True" />
                    </asp:GridView>
                </td>
            </tr>
            <tr style="color: blue; font-size: 14px;">
                <td style="height: 25px">
                    添加新类别:<asp:TextBox ID="txtErrTypeName" runat="server" Width="117px"></asp:TextBox>
                    <asp:Button ID="Btn_Add" runat="server" OnClick="Btn_Add_Click" Text="添加" />
                </td>
            </tr>
        </table>
        <asp:SqlDataSource ID="errTypeInfoDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="SELECT [errTypeName], [errTypeId] FROM [errTypeInfo]" DeleteCommand="DELETE FROM [errTypeInfo] WHERE [errTypeId] = @errTypeId"
            UpdateCommand="UPDATE [errTypeInfo] SET [errTypeName] = @errTypeName WHERE [errTypeId] = @errTypeId">
            <DeleteParameters>
                <asp:Parameter Name="errTypeId" Type="String" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="errTypeName" Type="String" />
                <asp:Parameter Name="errTypeId" Type="Int16" />
            </UpdateParameters>
        </asp:SqlDataSource>
    </div>
    </form>
</body>
</html>
